Remove GtkHBox
authorTimm Bäder <mail@baedert.org>
Mon, 3 Oct 2016 17:52:23 +0000 (19:52 +0200)
committerBenjamin Otte <otte@redhat.com>
Sun, 16 Oct 2016 16:17:21 +0000 (18:17 +0200)
13 files changed:
docs/reference/gtk/gtk4-sections.txt
gtk/deprecated/Makefile.inc
gtk/deprecated/gtkhbox.c [deleted file]
gtk/deprecated/gtkhbox.h [deleted file]
gtk/gtk-builder-tool.c
gtk/gtk.h
gtk/gtkbox.c
gtk/gtkcontainer.c
gtk/gtkgrid.c
tests/testfontselection.c
tests/testheightforwidth.c
testsuite/gtk/builder.c
testsuite/gtk/notify.c

index 6ce7a69d86716814f81274c4c67ed2370dc3399b..b3155a68ca37248240914a22750ed27243976645 100644 (file)
@@ -1787,22 +1787,6 @@ GTK_HBUTTON_BOX_GET_CLASS
 gtk_hbutton_box_get_type
 </SECTION>
 
-<SECTION>
-<FILE>gtkhbox</FILE>
-<TITLE>GtkHBox</TITLE>
-GtkHBox
-gtk_hbox_new
-<SUBSECTION Standard>
-GTK_HBOX
-GTK_IS_HBOX
-GTK_TYPE_HBOX
-GTK_HBOX_CLASS
-GTK_IS_HBOX_CLASS
-GTK_HBOX_GET_CLASS
-<SUBSECTION Private>
-gtk_hbox_get_type
-</SECTION>
-
 <SECTION>
 <FILE>gtkhpaned</FILE>
 <TITLE>GtkHPaned</TITLE>
index 4d2ba56f977ebfafa62c5053fcb2198d5008be2e..45039387f49b412c3fd352d75117818515c6a717 100644 (file)
@@ -10,7 +10,6 @@ deprecated_h_sources =                        \
        deprecated/gtkgradient.h        \
        deprecated/gtkhandlebox.h       \
        deprecated/gtkhbbox.h           \
-       deprecated/gtkhbox.h            \
        deprecated/gtkhpaned.h          \
        deprecated/gtkhscale.h          \
        deprecated/gtkhscrollbar.h      \
@@ -55,7 +54,6 @@ deprecated_c_sources =                        \
        deprecated/gtkgradient.c        \
        deprecated/gtkhandlebox.c       \
        deprecated/gtkhbbox.c           \
-       deprecated/gtkhbox.c            \
        deprecated/gtkhpaned.c          \
        deprecated/gtkhscale.c          \
        deprecated/gtkhscrollbar.c      \
diff --git a/gtk/deprecated/gtkhbox.c b/gtk/deprecated/gtkhbox.c
deleted file mode 100644 (file)
index 433ba75..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-/* GTK - The GIMP Toolkit
- * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library. If not, see <http://www.gnu.org/licenses/>.
- */
-
-/*
- * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
- * file for a list of people on the GTK+ Team.  See the ChangeLog
- * files for a list of changes.  These files are distributed with
- * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
- */
-
-#include "config.h"
-
-#include "gtkboxprivate.h"
-#include "gtkorientable.h"
-
-#include "gtkhbox.h"
-
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-
-/**
- * SECTION:gtkhbox
- * @Short_description: A horizontal container box
- * @Title: GtkHBox
- * @See_also: #GtkVBox
- *
- * #GtkHBox is a container that organizes child widgets into a single row.
- *
- * Use the #GtkBox packing interface to determine the arrangement,
- * spacing, width, and alignment of #GtkHBox children.
- *
- * All children are allocated the same height.
- *
- * GtkHBox has been deprecated. You can use #GtkBox instead, which is a
- * very quick and easy change. If you have derived your own classes from
- * GtkHBox, you can simply change the inheritance to derive directly
- * from #GtkBox. No further changes are needed, since the default
- * value of the #GtkOrientable:orientation property is
- * %GTK_ORIENTATION_HORIZONTAL.
- * If you don’t need first-child or last-child styling, and want your code
- * to be future-proof, the recommendation is to switch to #GtkGrid instead
- * of nested boxes. For more information about migrating to #GtkGrid,
- * see [Migrating from other containers to GtkGrid][gtk-migrating-GtkGrid].
- */
-
-
-G_DEFINE_TYPE (GtkHBox, gtk_hbox, GTK_TYPE_BOX)
-
-static void
-gtk_hbox_class_init (GtkHBoxClass *class)
-{
-}
-
-static void
-gtk_hbox_init (GtkHBox *hbox)
-{
-  gtk_orientable_set_orientation (GTK_ORIENTABLE (hbox),
-                                  GTK_ORIENTATION_HORIZONTAL);
-
-  _gtk_box_set_old_defaults (GTK_BOX (hbox));
-}
-
-/**
- * gtk_hbox_new:
- * @homogeneous: %TRUE if all children are to be given equal space allotments.
- * @spacing: the number of pixels to place by default between children.
- *
- * Creates a new #GtkHBox.
- *
- * Returns: a new #GtkHBox.
- *
- * Deprecated: 3.2: You can use gtk_box_new() with %GTK_ORIENTATION_HORIZONTAL instead,
- *   which is a quick and easy change. But the recommendation is to switch to
- *   #GtkGrid, since #GtkBox is going to go away eventually.
- *   See [Migrating from other containers to GtkGrid][gtk-migrating-GtkGrid].
- */
-GtkWidget *
-gtk_hbox_new (gboolean homogeneous,
-             gint     spacing)
-{
-  return g_object_new (GTK_TYPE_HBOX,
-                       "spacing",     spacing,
-                       "homogeneous", homogeneous ? TRUE : FALSE,
-                       NULL);
-}
diff --git a/gtk/deprecated/gtkhbox.h b/gtk/deprecated/gtkhbox.h
deleted file mode 100644 (file)
index 45c746d..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/* GTK - The GIMP Toolkit
- * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.         See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library. If not, see <http://www.gnu.org/licenses/>.
- */
-
-/*
- * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
- * file for a list of people on the GTK+ Team.  See the ChangeLog
- * files for a list of changes.  These files are distributed with
- * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
- */
-
-#ifndef __GTK_HBOX_H__
-#define __GTK_HBOX_H__
-
-
-#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
-#error "Only <gtk/gtk.h> can be included directly."
-#endif
-
-#include <gtk/gtkbox.h>
-
-
-G_BEGIN_DECLS
-
-#define GTK_TYPE_HBOX            (gtk_hbox_get_type ())
-#define GTK_HBOX(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_HBOX, GtkHBox))
-#define GTK_HBOX_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_HBOX, GtkHBoxClass))
-#define GTK_IS_HBOX(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_HBOX))
-#define GTK_IS_HBOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_HBOX))
-#define GTK_HBOX_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_HBOX, GtkHBoxClass))
-
-
-typedef struct _GtkHBox              GtkHBox;
-typedef struct _GtkHBoxClass  GtkHBoxClass;
-
-struct _GtkHBox
-{
-  GtkBox box;
-};
-
-struct _GtkHBoxClass
-{
-  GtkBoxClass parent_class;
-};
-
-
-GDK_DEPRECATED_IN_3_2
-GType       gtk_hbox_get_type (void) G_GNUC_CONST;
-GDK_DEPRECATED_IN_3_2_FOR(gtk_box_new)
-GtkWidget * gtk_hbox_new      (gboolean homogeneous,
-                               gint     spacing);
-
-G_END_DECLS
-
-#endif /* __GTK_HBOX_H__ */
index 24171abce676eb675cb5899de82bd5c74c614fa0..cb5e8643c2e9a118d90a40fc2770b99416cdbacd 100644 (file)
@@ -195,7 +195,6 @@ needs_explicit_setting (MyParserData *data,
     { "GtkWidget", "vexpand", 0 },
     { "GtkContainer", "border-width", 0 },
     { "GtkVBox", "expand", 1 },
-    { "GtkHBox", "expand", 1 },
     { NULL, NULL, 0 }
   };
   gchar *canonical_name;
index 6a41b0d63cd74164d2b986e7da284cb20e867f1e..a8584540380a1e16c304e4fcd81c4e17fddb2287 100644 (file)
--- a/gtk/gtk.h
+++ b/gtk/gtk.h
 #include <gtk/deprecated/gtkgradient.h>
 #include <gtk/deprecated/gtkhandlebox.h>
 #include <gtk/deprecated/gtkhbbox.h>
-#include <gtk/deprecated/gtkhbox.h>
 #include <gtk/deprecated/gtkhpaned.h>
 #include <gtk/deprecated/gtkhsv.h>
 #include <gtk/deprecated/gtkhscale.h>
index e39eb495a56d50d9d1bb257033d60504d4a23c89..c2c34bc3f306a9fe7e7cab789a0b56fa5d619304 100644 (file)
@@ -306,10 +306,6 @@ gtk_box_class_init (GtkBoxClass *class)
    *
    * Whether the child should receive extra space when the parent grows.
    *
-   * Note that the default value for this property is %FALSE for GtkBox,
-   * but #GtkHBox, #GtkVBox and other subclasses use the old default
-   * of %TRUE.
-   *
    * Note that the #GtkWidget:halign, #GtkWidget:valign, #GtkWidget:hexpand
    * and #GtkWidget:vexpand properties are the preferred way to influence
    * child size allocation in containers.
index 55feadf8b25f70b3491b65137ebc0e5554f7a2bb..d90370b0b4d5ec2d09f3a314eeb9798745890cbb 100644 (file)
@@ -87,7 +87,7 @@
  *
  * The second type of container can have more than one child; its purpose is to
  * manage layout. This means that these containers assign
- * sizes and positions to their children. For example, a #GtkHBox arranges its
+ * sizes and positions to their children. For example, a horizontal #GtkBox arranges its
  * children in a horizontal row, and a #GtkGrid arranges the widgets it contains
  * in a two-dimensional grid.
  *
index 5fed33fe2d9d3f92a19aebaddb11a5c301847d9e..357dbb1bc71ee20f85f099142aff258ab527eb9a 100644 (file)
@@ -36,7 +36,7 @@
  * SECTION:gtkgrid
  * @Short_description: Pack widgets in a rows and columns
  * @Title: GtkGrid
- * @See_also: #GtkTable, #GtkHBox, #GtkVBox
+ * @See_also: #GtkTable, #GtkVBox
  *
  * GtkGrid is a container which arranges its child widgets in
  * rows and columns. It is a very similar to #GtkTable and #GtkBox,
index 8c87b2c6c4f0a10cbaedf430989a21479bed29d0..fc384d6193ffe122d8e13ee99db86f6e75f3ea46 100644 (file)
@@ -46,7 +46,7 @@ main (int argc, char *argv[])
 
   window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
   gtk_widget_set_size_request (window, 600, 600);
-  hbox = gtk_hbox_new (FALSE, 6);
+  hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
   gtk_container_add (GTK_CONTAINER (window), hbox);
 
 #ifndef GTK_DISABLE_DEPRECATED
index fe47ed30a5c2f280cbaaf46240e4c7f8f6f00680..ba3fd0188f95daa111011e9e6c9f1f64fbaddab1 100644 (file)
@@ -43,7 +43,8 @@ TestInterface interfaces[] = {
     "    <property name=\"default_width\">450</property>"
     "    <property name=\"default_height\">50</property>"
     "    <child>"
-    "      <object class=\"GtkHBox\" id=\"hbox5\">"
+    "      <object class=\"GtkBox\" id=\"hbox5\">"
+    "        <property name\"orientation\"horizontal</property>"
     "        <property name=\"visible\">True</property>"
     "        <child>"
     "          <object class=\"GtkLabel\" id=\"label9\">"
@@ -211,7 +212,8 @@ TestInterface interfaces[] = {
     "          <object class=\"GtkVBox\" id=\"vbox1\">"
     "            <property name=\"visible\">True</property>"
     "            <child>"
-    "              <object class=\"GtkHBox\" id=\"hbox1\">"
+    "              <object class=\"GtkBox\" id=\"hbox1\">"
+    "                <property name\"orientation\"horizontal</property>"
     "                <property name=\"visible\">True</property>"
     "                <child>"
     "                  <object class=\"GtkButton\" id=\"button1\">"
@@ -313,7 +315,8 @@ TestInterface interfaces[] = {
     "        <property name=\"visible\">True</property>"
     "        <property name=\"can_focus\">True</property>"
     "        <child>"
-    "          <object class=\"GtkHBox\" id=\"hbox1\">"
+    "          <object class=\"GtkBox\" id=\"hbox1\">"
+    "            <property name\"orientation\"horizontal</property>"
     "            <property name=\"visible\">True</property>"
     "            <child>"
     "              <object class=\"GtkLabel\" id=\"label1\">"
@@ -364,7 +367,8 @@ TestInterface interfaces[] = {
     "          </packing>"
     "        </child>"
     "        <child>"
-    "          <object class=\"GtkHBox\" id=\"hbox2\">"
+    "          <object class=\"GtkBox\" id=\"hbox2\">"
+    "            <property name\"orientation\"horizontal</property>"
     "            <property name=\"visible\">True</property>"
     "            <child>"
     "              <object class=\"GtkFrame\" id=\"frame2\">"
@@ -438,7 +442,8 @@ TestInterface interfaces[] = {
     "          <object class=\"GtkVBox\" id=\"vbox1\">"
     "            <property name=\"visible\">True</property>"
     "            <child>"
-    "              <object class=\"GtkHBox\" id=\"hbox1\">"
+    "              <object class=\"GtkBox\" id=\"hbox1\">"
+    "                <property name\"orientation\"horizontal</property>"
     "                <property name=\"visible\">True</property>"
     "                <property name=\"spacing\">6</property>"
     "                <child>"
@@ -676,7 +681,8 @@ TestInterface interfaces[] = {
     "            <property name=\"visible\">True</property>"
     "            <property name=\"spacing\">5</property>"
     "            <child>"
-    "              <object class=\"GtkHBox\" id=\"hbox1\">"
+    "              <object class=\"GtkBox\" id=\"hbox1\">"
+    "                <property name\"orientation\"horizontal</property>"
     "                <property name=\"visible\">True</property>"
     "                <property name=\"spacing\">5</property>"
     "                <child>"
@@ -777,7 +783,8 @@ TestInterface interfaces[] = {
     "              </packing>"
     "            </child>"
     "            <child>"
-    "              <object class=\"GtkHBox\" id=\"hbox2\">"
+    "              <object class=\"GtkBox\" id=\"hbox2\">"
+    "                <property name\"orientation\"horizontal</property>"
     "                <property name=\"visible\">True</property>"
     "                <property name=\"spacing\">5</property>"
     "                <child>"
index 9aad57aa215727aa0b4ce7af6d22dab1e0c33ebc..61228ee2f4786f7a818b46f12bcf1cef5329d604 100644 (file)
@@ -91,7 +91,7 @@ test_parser (void)
   g_error_free (error);
 
   error = NULL;
-  gtk_builder_add_from_string (builder, "<interface><object class=\"GtkVBox\" id=\"a\"><object class=\"GtkHBox\" id=\"b\"/></object></interface>", -1, &error);
+  gtk_builder_add_from_string (builder, "<interface><object class=\"GtkVBox\" id=\"a\"><object class=\"GtkBox\" id=\"b\"/></object></interface>", -1, &error);
   g_assert_error (error, GTK_BUILDER_ERROR, GTK_BUILDER_ERROR_INVALID_TAG);
   g_error_free (error);
 
@@ -724,7 +724,6 @@ test_types (void)
     "  <object class=\"GtkEntry\" id=\"entry\"/>"
     "  <object class=\"GtkFontButton\" id=\"fontbutton\"/>"
     "  <object class=\"GtkHButtonBox\" id=\"hbuttonbox\"/>"
-    "  <object class=\"GtkHBox\" id=\"hbox\"/>"
     "  <object class=\"GtkHPaned\" id=\"hpaned\"/>"
     "  <object class=\"GtkHScale\" id=\"hscale\"/>"
     "  <object class=\"GtkHScrollbar\" id=\"hscrollbar\"/>"
@@ -2428,7 +2427,8 @@ test_message_area (void)
     "<interface>"
     "  <object class=\"GtkInfoBar\" id=\"infobar1\">"
     "    <child internal-child=\"content_area\">"
-    "      <object class=\"GtkHBox\" id=\"contentarea1\">"
+    "      <object class=\"GtkBox\" id=\"contentarea1\">"
+    "        <property name=\"orientation\">horizontal</property>"
     "        <child>"
     "          <object class=\"GtkLabel\" id=\"content\">"
     "            <property name=\"label\" translatable=\"yes\">Message</property>"
@@ -2670,7 +2670,8 @@ test_no_ids (void)
     "<interface>"
     "  <object class=\"GtkInfoBar\">"
     "    <child internal-child=\"content_area\">"
-    "      <object class=\"GtkHBox\">"
+    "      <object class=\"GtkBox\">"
+    "        <property name=\"orientation\">horizontal</property>"
     "        <child>"
     "          <object class=\"GtkLabel\">"
     "            <property name=\"label\" translatable=\"yes\">Message</property>"
index 4c186b99aa472b5f52dff3642a4777ff3dcd0810..4d297d425f144dba2ed77c74e2acd2eade7835d5 100644 (file)
@@ -374,7 +374,6 @@ test_type (gconstpointer data)
       g_str_equal (g_type_name (type), "GtkVScrollbar") ||
       g_str_equal (g_type_name (type), "GtkHSeparator") ||
       g_str_equal (g_type_name (type), "GtkVSeparator") ||
-      g_str_equal (g_type_name (type), "GtkHBox") ||
       g_str_equal (g_type_name (type), "GtkVBox") ||
       g_str_equal (g_type_name (type), "GtkArrow") ||
       g_str_equal (g_type_name (type), "GtkNumerableIcon") ||